# -*- coding: utf-8 -*-
# ===========================================
# @Time    : 2021/9/10 17:58 
# @Author  : shutao
# @FileName: base_dataset.py
# @remark  : 
# 
# @Software: PyCharm
# Github 　： https://github.com/NameLacker
# ===========================================

from abc import abstractmethod
from typing import Dict
import numpy as np
import paddle
from paddle.io import Dataset


class BaseDataset(Dataset):
    """Base class of any dataset"""

    def __init__(self):
        super(BaseDataset, self).__init__()
        # 图形文件输出尺寸
        self.img_size = None
        # 数据文件路径
        self.datafile = None
        # 数据列表
        self.datalist = []

        # 预处理方法
        self.transfromer: paddle.vision.transforms.Compose
        pass

    @abstractmethod
    def __getitem__(self, item: int) -> Dict[paddle.Tensor, np.ndarray]:
        pass

    @abstractmethod
    def __len__(self) -> int:
        pass
